<template>
	<view class="">
		<view>加减法页面</view>
		<view>
			<Calculate @calculate = "handleAdd" operation="+"></Calculate>
			<view>加法结果：{{ resultAdd }}</view>
		</view>
		<view style="padding: 50rpx 0;"></view>
		<view>
			<Calculate @calculate = "handleLess" operation="-"></Calculate>
			<view>减法结果：{{ resultLess }}</view>
		</view>
	</view>
</template>

<script setup>
	import Calculate from '@/components/calculator/calculator.vue'
import { ref } from 'vue';
	
	const resultAdd =ref(0)
	
	const resultLess =ref(0)
	
	const handleAdd = ({num1,num2}) =>{
		resultAdd.value = Number(num1) + Number(num2)
	}
	
	const handleLess = ({num1,num2}) =>{
		resultLess.value = Number(num1) - Number(num2)
	}
</script>

<style lang="scss" scoped>
	
</style>
